﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Shopfloormanagement
{
    public static class SystemInfo
    {
        public static int D_color = 2;
        public static int C_color = 2;
        public static string db = string.Empty;
        public static string SQL;//= $"Server={_dbAddr};Database={_dbName};uid=MES;pwd=@!Mahle1234";
        public static string sys;//= $"Server={_dbAddr};Database=SFM;uid=MES;pwd=@!Mahle1234";
        public static void UpdateSQLconnection(string server,string database)
        {
            SQL = $"Server={server};Database={database};uid=MES;pwd=@!Mahle1234";
            sys = $"Server={server};Database=SFMsys;uid=MES;pwd=@!Mahle1234";
        }
       

        public static string iconAddr = "\\\\192.168.1.18\\智慧工厂共享文件夹\\智慧工厂共享文件夹\\SFM发布文件\\departmentICON";
        public static int parent = 0;
        
        //浏览相关
        public static int readLevel = 0;
        public static int readFactory = 0;
        public static int readDepartment = 0;
        public static int readparentDep = 0;

        //浏览相关文字
        public static string readFactoryName = string.Empty;
        public static string readDepName = string.Empty;
        public static string readparentDepName = string.Empty;

        private static string Lang = "";
        private static string ServerIP = "";
        private static string Database = "";

        private static string LoginName = "";
        private static string Password = "";

        private static int UserID = 0;
        private static string UserName = string.Empty;
        private static int userDepID = 0;
        private static string userDepname = string.Empty;
        private static int userFacID = 0;
        private static string userFacname = string.Empty;
        private static int userLevel = -1;
        public static int userRole = 0;
        public static int form_idx = -1;

        public static DataTable depEmployee = new DataTable();

        
        public static int userlevel
        {
            get { return userLevel; }
            set { userLevel = value; }
        }
        public static int userID
        {
            get { return UserID; }
            set { UserID = value; }
        }

        public static int userdepartment_ID
        {
            get { return userDepID; }
            set { userDepID = value; }
        }
        public static string userdepartment_Name
        {
            get { return userDepname; }
            set { userDepname = value; }
        }

        public static int userfactoryID
        {
            get { return userFacID; }
            set { userFacID = value; }
        }
        public static string factory_name
        {
            get { return userFacname; }
            set { userFacname = value; }
        }

        public static string userName
        {
            get { return UserName; }
            set { UserName = value; }
        }

        public static string lang
        {
            get { return Lang; }
            set { Lang = value; }
        }

        public static string serverIP
        {
            get { return ServerIP; }
            set { ServerIP = value; }
        }

        public static string database
        {
            get { return Database; }
            set { Database = value; }
        }

        public static string loginName
        {
            get { return LoginName; }
            set { LoginName = value; }
        }

        public static string password
        {
            get { return Password; }
            set { Password = value; }
        }

        private static int Plant_ID = 0;
        private static string Role = "";

        public static int plant_ID
        {
            get { return Plant_ID; }
            set { Plant_ID = value; }
        }

        public static string role
        {
            get { return Role; }
            set { Role = value; }
        }

       
    }
}